var isInIFrame = (window.location != window.parent.location) ? true : false;
var PageDimensions = function () {
	var b;
	var c;

	function pagedimensionsCtor() {
		var a = document.createElement("div");
		a.setAttribute("style", "visibility:hidden;position:fixed;bottom:0px;right:0px;");
		document.getElementsByTagName("body")[0].appendChild(a);
		b = a.offsetLeft;
		c = a.offsetTop;
		a.parentNode.removeChild(a)
	}
	pagedimensionsCtor();

	function Reset() {
		pagedimensionsCtor()
	}
	function GetPageHeight() {
		return c
	}
	function GetPageWidth() {
		return b
	}
	return {
		Reset: Reset,
		GetPageHeight: GetPageHeight,
		GetPageWidth: GetPageWidth
	}
};
var viewPort = "";
var viewPortWidth = 0;
var viewPortHeight = 0;
var scrollBarWidth = 0;
var galleryWidth = 0;
var smartAlbumsPerPage = 0;
var smartPhotosPerPage = 0;
var galleryContainer = "";
var galleryResponsive = false;
var controlBarAdjust = 0;
var buttonWidthText = 0;
var buttonWidthImage = 0;
var currentPageList = "";
var AlbumThumbWidth = 0;
var AlbumThumbHeight = 0;
var PhotoThumbWidth = 0;
var PhotoThumbHeight = 0;
var TotalThumbs = 0;
var TotalPages = 0;
var TotalTypes = 0;
var SortingOrder = "";
var SortingType = "";
(function ($) {
	$.ajaxSetup({
		cache: false
	});
	Array.prototype.frequencies = function () {
		var l = this.length,
			result = {
				all: []
			};
		while (l--) {
			result[this[l]] = result[this[l]] ? ++result[this[l]] : 1
		}
		for (var l in result) {
			if (result.hasOwnProperty(l) && l !== 'all') {
				result.all.push([l, result[l]])
			}
		}
		return result
	};
	if (!("contains" in Array.prototype)) {
		Array.prototype.contains = function (a) {
			var i = 0;
			for (i in this) {
				if (this[i] === a) {
					return true
				}
			};
			return false
		}
	}
})(jQuery);
(function ($) {
	$.fn.slideFade = function (a, b) {
		var c;
		for (var i = 0; i < arguments.length; i++) {
			if (typeof arguments[i] == "number") {
				c = arguments[i]
			} else {
				var d = arguments[i]
			}
		}
		if (!c) {
			c = 500
		}
		this.animate({
			opacity: 'toggle',
			height: 'toggle'
		}, c, function () {
			if (typeof d != "function") {
				d = function () {}
			}
			d.call(this)
		})
	}
})(jQuery);
(function ($) {
	$.extend($.expr[":"], {
		"containsNC": function (a, i, b, c) {
			return (a.textContent || a.innerText || "").toLowerCase().indexOf((b[3] || "").toLowerCase()) >= 0
		}
	});
	$.isVersion = function (a, b, c) {
		if (a) {
			var d = /pre/i,
				replace = /[^\d]+/g,
				b = b || "==",
				c = c || $().jquery,
				l = a.replace(replace, ''),
				r = c.replace(replace, ''),
				l_len = l.length,
				r_len = r.length,
				l_pre = d.test(a),
				r_pre = d.test(c);
			l = (r_len > l_len ? parseInt(l) * Math.pow(10, (r_len - l_len)) : parseInt(l));
			r = (l_len > r_len ? parseInt(r) * Math.pow(10, (l_len - r_len)) : parseInt(r));
			switch (b) {
			case "==":
				{
					return (true === (l == r && (l_pre == r_pre)))
				};
			case ">=":
				{
					return (true === (l >= r && (!l_pre || l_pre == r_pre)))
				};
			case "<=":
				{
					return (true === (l <= r && (!r_pre || r_pre == l_pre)))
				};
			case ">":
				{
					return (true === (l > r || (l == r && r_pre)))
				};
			case "<":
				{
					return (true === (l < r || (l == r && l_pre)))
				}
			}
		};
		return false
	};
	var e = $.event,
		$special, resizeTimeout;
	$special = e.special.debouncedresize = {
		setup: function () {
			$(this).on("resize", $special.handler)
		},
		teardown: function () {
			$(this).off("resize", $special.handler)
		},
		handler: function (a, b) {
			var c = this,
				args = arguments,
				dispatch = function () {
					a.type = "debouncedresize";
					e.dispatch.apply(c, args)
				};
			if (resizeTimeout) {
				clearTimeout(resizeTimeout)
			}
			b ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold)
		},
		threshold: 150
	};
	$(window).on("debouncedresize", function (d) {
		viewPort.Reset();
		setTimeout(function () {
			if (isInIFrame) {
				var a = $("#" + galleryContainer).height() + 20;
				var b = $("#" + galleryContainer).width() + 4;
				var c = getIframeID(this);
				if (c != "N/A") {
					window.top.document.getElementById("" + c + "").style.height = "" + a + "px";
					parent.document.getElementById("" + c + "").style.height = "" + a + "px"
				}
			}
		}, 100)
	});
	$.fn.isScrollable = function () {
		var a = $(this);
		return (a.css('overflow') == 'scroll' || a.css('overflow') == 'auto' || a.css('overflow-x') == 'scroll' || a.css('overflow-x') == 'auto' || a.css('overflow-y') == 'scroll' || a.css('overflow-y') == 'auto')
	}
})(jQuery);

function getIframeID(a) {
	var b = top;
	var c = location.href.split('?')[0];
	var d = top.document.getElementsByTagName('iframe');
	var x, i = d.length;
	while (i--) {
		x = d[i];
		if (x.src && x.src == c) {
			return ((x.id) ? x.id : 'N/A')
		}
	};
	return 'N/A'
};
(function ($) {
	$.fn.FB_Album = function (B) {
		$.event.special.debouncedresize.threshold = 250;
		if (!"console" in window || typeof console == "undefined") {
			var C = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
			var D = function () {};
			window.console = {};
			for (var i = 0; i < C.length; ++i) {
				window.console[C[i]] = D
			}
		};

		function getAbsolutePath() {
			var a = window.location;
			var b = a.pathname.substring(0, a.pathname.lastIndexOf('/') + 1);
			return a.href.substring(0, a.href.length - ((a.pathname + a.search + a.hash).length - b.length))
		};
		B = $.extend({
			facebookID: '',
			excludeAlbums: [],
			excludeImages: [],
			maxGraphLimit: 1000,
			responsiveGallery: true,
			responsiveWidth: 90,
			fixedWidth: 800,
			PathNoCoverImage: 'CSS/Images/no_cover.png',
			singleAlbumInitDescription: true,
			cacheAlbumContents: true,
			PagesButtonText: 'Skift side',
			SortButtonTextAlbums: 'Sorter albums',
			SortButtonTextPhotos: 'Sorter billeder',
			SortNameText: 'Albummets navn',
			SortItemsText: 'Antal billeder',
			SortAddedText: 'Tilf&oslash;jelsesdato',
			SortCreatedText: 'Oprettelsesdato',
			SortUpdatedText: 'Sidst opdateret',
			SortFacebookText: 'Facebook-r&aelig;kkef&oslash;lge',
			SortIDText: 'Facebook ID',
			FilterButtonTextAlbums: 'Opdaterede albums',
			FilterButtonTextPhotos: 'Billeder tilf&oslash;jet',
			SearchButtonTextAlbums: 'S&oslash;g albums',
			SearchButtonTextPhotos: 'S&oslash;g billeder',
			SearchDefaultText: '',
			AlbumContentPreText: 'Indhold:',
			AlbumCreatedPreText: 'Orettet:',
			AlbumUpdatedPreText: 'Opdateret:',
			AlbumShareMePreText: 'Del album:',
			AlbumNumericIDPreText: 'Album ID:',
			OutOfTotalImagesPreText: 'ud af',
			SingleImageWord: 'Billede',
			MultiImagesWord: 'Billeder',
			AlbumBackButtonText: 'Tilbage',
			AlbumTitlePreText: 'Albummets navn:',
			AlbumNoDescription: 'Ingen beskrivelse af albummet tilg&aelig;ngelig.',
			ImageLocationPreText: 'Lokation:',
			ImageNumberPreText: 'Billede ID:',
			ImageShareMePreText: 'Del billede:',
			colorBoxNoDescription: 'Ingen beskrivelse af billedet tilg&aelig;ngelig.',
			albumNameTitle: true,
			albumImageCount: true,
			albumDateCreate: true,
			albumDateUpdate: true,
			albumFacebookID: false,
			matchAlbumPhotoThumbs: false,
			albumThumbOverlay: true,
			albumThumbRotate: true,
			albumCCS3Shadow: false,
			albumShowOrder: true,
			photoThumbOverlay: true,
			photoThumbRotate: true,
			photoShowClearTape: true,
			photoShowYellowTape: true,
			photoShowPushPin: false,
			photoShowFBLink: true,
			photoShowNumber: true,
			fancyBoxAllow: true,
			fancyBoxOptions: {},
			outputCountAlbumID: false,
			consoleLogging: true,
			frameID: $(this).attr("id"),
			loaderID: 'FB_Album_Loader',
			galleryID: 'FB_Album_Display'
		}, B);
		var E = 0;
		var F = 0;
		var G = 0;
		var H = 0;
		var I = "";
		var J = new Array();
		var K = new Array();
		var L = 9;
		var M = 20;
		var N = '';
		var O = '';
		var P = new Array();
		var Q = new Array();
		galleryContainer = B.frameID;
		galleryResponsive = B.responsiveGallery;
		controlBarAdjust = B.controlBarTopOffset;
		P.push(B.defaultSortByAlbumTitle);
		P.push(B.defaultSortByNumberImages);
		P.push(B.defaultSortByDateCreated);
		P.push(B.defaultSortByDateUpdated);
		P.push(B.defaultSortByFacebookOrder);
		Q.push(B.defaultPhotoSortAdded);
		Q.push(B.defaultPhotoSortUpdated);
		Q.push(B.defaultPhotoSortOrder);
		Q.push(B.defaultPhotoSortID);
		var R = P.frequencies();
		var S = Q.frequencies();
		viewPort = new PageDimensions();
		scrollBarWidth = scrollBarWidth();
		viewPortWidth = viewPort.GetPageWidth();
		viewPortHeight = viewPort.GetPageHeight();
		galleryWidth = Math.round((B.responsiveGallery == true ? ((viewPortWidth - scrollBarWidth) * B.responsiveWidth / 100) : B.fixedWidth));
		if (B.consoleLogging) {
			console.log("Usable Screen Size Detection: Width = " + viewPortWidth + "px / Height = " + viewPortHeight + "px / Width of Scrollbar: " + scrollBarWidth + "px / Width of Gallery: " + galleryWidth + "px")
		};
		N = 'albumTitle';
		O = 'addedDate';
		if (B.AlbumShareMePreText.substr(B.AlbumShareMePreText.length - 1) == ":") {
			B.AlbumShareMePreText = B.AlbumShareMePreText.slice(0, -1)
		};
		if (B.ImageShareMePreText.substr(B.ImageShareMePreText.length - 1) == ":") {
			B.ImageShareMePreText = B.ImageShareMePreText.slice(0, -1)
		};

		function galleryAlbumsInit() {
			$('#fb-album-header').html("");
			$('#fb-album-footer').html("");
			if ($('#fb-albums-all-paged').length != 0) {
				$('#fb-albums-all-paged').fadeIn(700);
				var a = $('#fb-albums-all');
				a.isotope('reloadItems');
				a.isotope('reLayout');
				$('html, body').animate({
					scrollTop: $("#" + B.frameID).offset().top - 20
				}, 'slow')
			} else {
				$("<div>", {
					id: "fb-albums-all"
				}).appendTo("#fb-album-content");
				galleryAlbumsShow()
			}
		};

		function galleryAlbumsShow() {
			var z = B.excludeAlbums.length + 9 + 1;
			var A = "https://graph.facebook.com/" + B.facebookID + "/albums?fields=id,name,cover_photo,count,created_time,updated_time,description,link,type,location,place,from,privacy&limit=" + z;
			$.ajax({
				url: A,
				cache: false,
				dataType: "jsonp",
				success: function (x) {
					$.each(x.data, function (k, g) {
						if (typeof g.cover_photo !== "undefined") {
							if (typeof(g.count) != "undefined") {
								if (B.outputCountAlbumID) {
									alert(i + ": " + g.id + " / " + g.count)
								}
								if ((($.inArray(g.id, B.excludeAlbums) == -1))) {
									E = E + 1;
									if ((E <= 9) || (9 === 0)) {
										if ((g.count > 20) && (20 != 0)) {
											var h = 20 + " "
										} else {
											var h = g.count + " "
										}
										if (B.albumDateCreate) {
											var j = new XDate(g.created_time);
											var l = Math.abs(j.clone().toString("z"));
											j = j.clone().addHours(l).toString("MM/dd/yyyy - hh:mm TT")
										}
										if (B.albumDateUpdate) {
											var m = new XDate(g.updated_time);
											var n = Math.abs(m.clone().toString("z"));
											m = m.clone().addHours(n).toString("MM/dd/yyyy - hh:mm TT")
										}
										if (this.count > 1) {
											h += B.MultiImagesWord
										} else {
											h += B.SingleImageWord
										}
										if ((this.count > 20) && (20 != 0)) {
											h += " (" + B.OutOfTotalImagesPreText + " " + g.count + " " + B.MultiImagesWord + ")"
										}
										if (!B.matchAlbumPhotoThumbs) {
											var o = 'width: ' + (290 + 5 * 2) + 'px; margin: ' + 10 + 'px; display: none;'
										} else {
											var o = 'width: ' + (290 + 10) + 'px; margin: ' + 10 + 'px; display: none;'
										}
										var p = "";
										if (!B.matchAlbumPhotoThumbs) {
											var q = '<div id="' + g.id + '" class="albumThumb fbLink' + p + (B.albumCCS3Shadow == true ? " ShadowCSS3" : "") + '" title="' + g.name + '" data-link="' + g.link + '" style="width:' + (280) + 'px; height:' + (200) + 'px; padding: ' + 5 + 'px;" data-href="#album-' + g.id + '">'
										} else {
											var q = '<div id="' + g.id + '" class="albumThumb fbLink' + p + (B.albumCCS3Shadow == true ? " ShadowCSS3" : "") + '" title="' + g.name + '" data-link="' + g.link + '" style="width:' + (280) + 'px; height:' + (200) + 'px; padding: 5px;" data-href="#album-' + g.id + '">'
										}
										q += '<span class="PaperClipLeft"></span>';
										q += '<div class="fb-album-shadow1" style="top: ' + (200 + 12) + 'px;"></div>';
										if (5 == 0) {
											q += '<span id="Wrap_' + g.id + '" style="border: none;" class="albumThumbWrap" style="width:' + 280 + 'px; height:' + 200 + 'px; padding: ' + 5 + 'px; left: ' + 5 + 'px; top: ' + 5 + 'px;">'
										} else {
											q += '<span id="Wrap_' + g.id + '" class="albumThumbWrap" style="width:' + 280 + 'px; height:' + 200 + 'px; padding: ' + 5 + 'px; left: ' + 5 + 'px; top: ' + 5 + 'px;">'
										}
										if (!B.matchAlbumPhotoThumbs) {
											q += '<i class="fb-album-spinner" id="fb-album-spinner-' + g.cover_photo + '" style="width:' + 280 + 'px; height:' + 200 + 'px;"></i>'
										} else {
											q += '<i class="fb-album-spinner" id="fb-album-spinner-' + g.cover_photo + '" style="width:' + 280 + 'px; height:' + 200 + 'px; top: 0px; left: 0px;"></i>'
										}
										q += '<i class="fb-album-thumb" id="fb-album-thumb-' + g.cover_photo + '" style="width:' + 280 + 'px; height:' + 200 + 'px;"></i>';
										if (!B.matchAlbumPhotoThumbs) {
											q += '<i class="fb-album-overlay" id="fb-album-overlay-' + g.cover_photo + '" style="width:' + 280 + 'px; height:' + 200 + 'px; padding: ' + 5 + 'px;"></i>'
										} else {
											q += '<i class="fb-album-overlay" id="fb-album-overlay-' + g.cover_photo + '" style="width:' + 280 + 'px; height:' + 200 + 'px; padding: ' + 0 + 'px; left: -' + 0 + 'px; top: -' + 0 + 'px; "></i>'
										}
										q += '</span>';
										q += '</div>';
										q += '<div class="albumDetails" title="' + g.id + '" style="width:' + (290 + 2 * 0) + 'px; padding-top: ' + ((B.albumShowShadow == true ? 12 : 0) + 0) + 'px;">';
										q += '<div class="albumText">';
										if (B.albumNameTitle) {
											q += '<div class="fbLink" style="width: ' + 290 + 'px;" href="#album-' + g.id + '"><span class="albumName" data-albumid="' + g.id + '" title="' + g.name + '">' + g.name + '</span></div>'
										}
										if (B.albumImageCount) {
											q += '<div class="clearfix" style="width: ' + 290 + 'px; display: block;"><div class="albumCount">' + B.AlbumContentPreText + '</div><div class="albumInfo clearfix">' + h + '</div></div>'
										}
										if (B.albumDateCreate) {
											q += '<div class="clearfix" style="width: ' + 290 + 'px; display: block;"><div class="albumCreate">' + B.AlbumCreatedPreText + '</div><div class="albumInfo clearfix">' + j + '</div></div>'
										}
										if (B.albumDateUpdate) {
											q += '<div class="clearfix" style="width: ' + 290 + 'px; display: block;"><div class="albumUpdate">' + B.AlbumUpdatedPreText + '</div><div class="albumInfo clearfix">' + m + '</div></div>'
										}
										if (B.albumFacebookID) {
											q += '<div class="clearfix" style="width: ' + 290 + 'px; display: block;"><div class="albumUpdate">' + B.AlbumNumericIDPreText + '</div><div class="albumInfo clearfix">' + this.id + '</div></div>'
										}
										q += '</div>';
										q += '</div>';
										if (((E <= 9) && (9 > 0)) || (9 === 0)) {
											var r = g.type;
											if ((r != "wall")) {
												$("<div>", {
													"class": "albumWrapper",
													"id": "coverWrapper-" + g.cover_photo,
													"data-type": '',
													"data-title": g.name,
													"data-cover": g.cover_photo,
													"data-create": g.created_time,
													"data-update": g.updated_time,
													"data-count": g.count,
													"data-number": g.id,
													"data-order": E,
													"data-id": g.id,
													style: o,
													html: q
												}).appendTo("#fb-albums-all").fadeIn(500, function () {});
												$('#' + g.id).live('click', function (e) {
													$(this).find(".fb-album-overlay").stop().animate({
														opacity: 0
													}, "slow");
													checkExisting($(this).attr('data-href'))
												});
												var s = E - 1;
												var t = "";
												var u = "";
												if (B.consoleLogging) {
													if (g.count > 1) {
														if ((20 > 0) && (g.count > 20)) {
															var v = 20 + " out of " + g.count + " Images"
														} else {
															var v = g.count + " Images"
														}
													} else {
														if ((20 > 0) && (g.count > 20)) {
															var v = 20 + " out of " + g.count + " Image"
														} else {
															var v = g.count + " Image"
														}
													}
												};
												var w = "https://graph.facebook.com/" + g.cover_photo + "?fields=album,from,created_time,height,width,source,name,link,picture";
												$.ajax({
													url: w,
													cache: false,
													dataType: "jsonp",
													success: function (f) {
														$.each([f], function (i, b) {
															t = g.id;
															u = b.id;
															s++;
															if (typeof(u) === "undefined") {
																var c = getAbsolutePath();
																c += B.PathNoCoverImage;
																var d = c;
															} else {
																var d = b.source;
															}
															var e = b.source.substring(b.source.lastIndexOf('.') + 1).toUpperCase();
															$("#coverWrapper-" + g.cover_photo).attr("data-type", e).addClass(e);
															$("#fb-album-thumb-" + g.cover_photo).attr("data-album", g.cover_photo).attr("data-loaded", "FALSE");
															$("#fb-album-thumb-" + g.cover_photo).hide().css("background-image", "url(" + (d) + ")");
															$("#fb-album-thumb-" + g.cover_photo).waitForImages({
																waitForAll: true,
																finished: function () {},
																each: function () {
																	var a = $(this).attr('data-album');
																	if ($("#fb-album-thumb-" + a).attr("data-loaded") == "FALSE") {
																		$("#fb-album-spinner-" + a).hide();
																		$("#fb-album-thumb-" + a).fadeIn(500);
																		$("#fb-album-thumb-" + a).attr("data-loaded", "TRUE")
																	}
																},
															})
														});
														if (B.consoleLogging) {
															console.log('Update: Cover Photo (' + u + ') link for album #' + s + '(' + t + ' / ' + v + ') could be successfully retrieved!')
														}
													},
													error: function (a, b, c) {
														console.log('Error: \njqXHR:' + a + '\ntextStatus: ' + b + '\nerrorThrown: ' + c)
													}
												})
											} else {
												E = E - 1
											}
										}
									}
								} else {}
							}
						}
					}); if (B.consoleLogging) {
						console.log('Update: Data for ' + E + ' album(s) for Facebook ID "' + B.facebookID + '" could be successfully retrieved!')
					}
					var y = $('#fb-albums-all');
					$("#" + B.loaderID).slideFade(700);
					$("#FB_Album_Display").slideFade(700);
					equalHeightFloat(true, B.facebookID);
					currentPageList = y;
					setTimeout(function () {
						var a = E;
						var b = {
							'searchBoxDefault': B.SearchDefaultText,
							'itemsPerPageDefault': a,
							'hideFilter': false,
							'hideSort': false,
							'hideSearch': false,
							'hidePager': false
						};
						new CallPagination(currentPageList, b, "fb-albums-all-paged", true, true, B.facebookID)
					}, 500);
					$('.albumWrapper .fb-album-thumb').waitForImages({
						waitForAll: true,
						finished: function () {},
						each: function () {
							var a = $(this).attr("data-album");
							if ($("#fb-album-thumb-" + a).attr("data-loaded") == "FALSE") {
								$("#fb-album-spinner-" + a).hide();
								$("#fb-album-thumb-" + a).hide().fadeIn(500);
								$("#fb-album-thumb-" + a).attr("data-loaded", "TRUE")
							}
						},
					});
					setTimeout(function () {
						if (isInIFrame) {
							var a = $("#" + B.frameID).height() + 20;
							var b = $("#" + B.frameID).width() + 4;
							var c = getIframeID(this);
							if (c != "N/A") {
								window.top.document.getElementById("" + c + "").style.height = "" + a + "px";
								parent.document.getElementById("" + c + "").style.height = "" + a + "px"
							}
						}
					}, 100)
				},
				error: function (a, b, c) {
					if (B.consoleLogging) {
						console.log('Error: \njqXHR:' + a + '\ntextStatus: ' + b + '\nerrorThrown: ' + c)
					}
				}
			})
		};

		function singleAlbumInit() {
			$("#" + B.loaderID).slideFade(700);
			if (B.cacheAlbumContents) {
				if ($('#fb-album-' + I).length != 0) {
					$('#fb-album-header').html(J[I]);
					if (B.bottomControlBar) {
						$('#fb-album-footer').html(K[I])
					};
					$('#Back-' + I + '_1').unbind("click").bind('click', function (e) {
						checkExisting($(this).attr('data-href'))
					});
					if (B.bottomControlBar) {
						$('#Back-' + I + '_2').unbind("click").bind('click', function (e) {
							checkExisting($(this).attr('data-href'))
						});
						$('#Back_To_Top-' + I).click(function (e) {
							$('html, body').animate({
								scrollTop: $("#" + B.frameID).offset().top - 20
							}, 'slow')
						})
					};
					$('#Back-' + I + '_3').unbind("click").bind('click', function (e) {
						checkExisting($(this).attr('data-href'))
					});
					$('.paginationMain').hide();
					$("#" + B.loaderID).slideFade(700);
					setTimeout(function () {
						$('#fb-album-paged-' + I).show();
						$('#fb-album-' + I).show();
						var a = $('#fb-album-' + I);
						a.isotope('reloadItems');
						a.isotope('reLayout');
						$('html, body').animate({
							scrollTop: $("#" + B.frameID).offset().top - 20
						}, 'slow');
						if (B.consoleLogging) {
							console.log('Update: All data for Album ' + I + ' has been restored from cache and set to visible!')
						}
					}, 800);
					return
				}
			} else {
				if ($('#fb-album-' + I).length != 0) {
					var f = $('#fb-album-' + I);
					f.isotope('destroy');
					$('#Back-' + I + '_1').unbind("click");
					if (B.bottomControlBar) {
						$('#Back-' + I + '_2').unbind("click")
					};
					$('#Back-' + I + '_3').unbind("click");
					$('#fb-album-paged' + I).remove();
					if (B.consoleLogging) {
						console.log('Update: All data for Album ' + I + ' has been removed from DOM!')
					}
				}
			}
			F = 0;
			var g = "https://graph.facebook.com/" + I + "?fields=description,count,cover_photo,id,link,location,name,place,from,created_time,updated_time,type";
			$.ajax({
				url: g,
				cache: false,
				dataType: "jsonp",
				success: function (d) {
					$.each([d], function (i, a) {
						var b = a.name;
						var c = "";
						if (a.description) {
							c += a.description
						};
						if (a.location) {
							if (c != "") {
								c += ' '
							};
							c += '[' + B.ImageLocationPreText + ' ' + a.location + ']'
						}
						if ((c != '') && (c != ' ')) {
							c = '<p>' + c + '</p>'
						} else {
							c = '<p>' + B.AlbumNoDescription + '</p>'
						};
						header = '<div data-href="#" id="Back-' + I + '_1" class="BackButton fbLink clearfix">' + B.AlbumBackButtonText + '</div>';
						footer = '<div class="seperator clearfix" style="width: 100%;"></div>';
						footer += '<div data-href="#" id="Back-' + I + '_2" class="BackButton fbLink clearfix">' + B.AlbumBackButtonText + '</div>';
						footer += '<ul id="Top-' + I + '" class="TopButton fbLink clearfix"><li><a style="width: 40px;" id="Back_To_Top-' + I + '"><div id="To_Top_' + I + '" class="Album_To_Top"></div></a></li></ul>';
						header += '<div id="Link-' + I + '" class="albumFacebook"><a href="' + a.link + '" target="_blank" style="text-decoration: none; border: 0px;"><div class="albumLinkSimple TipGallery" style="top: 25px;" title="Klik her for at se albummet p&aring; Facebook!"></div></a></div>';
						header += '<div class="albumTitle clearfix">' + B.AlbumTitlePreText + ' ' + b + '</div>';
						if (B.singleAlbumInitDescription) {
							header += '<div class="albumDesc clearfix">' + c + '</div>'
						};
						header += '<div class="seperator clearfix" style="width: 100%;"></div>';
						J[I] = header;
						K[I] = footer;
						$('#fb-album-header').html(header).hide();
						if (B.bottomControlBar) {
							$('#fb-album-footer').html(footer).hide()
						};
						$("<div>", {
							id: 'fb-album-' + I,
							"class": 'album'
						}).appendTo("#fb-album-content").hide();
						H = a.count
					});
					singleAlbumShow(H);
					$('#Back-' + I + '_1').live('click', function (e) {
						if (!B.cacheAlbumContents) {
							$('#fb-album-' + I).remove()
						}
						checkExisting($(this).attr('data-href'))
					});
					$('#Back-' + I + '_2').live('click', function (e) {
						if (!B.cacheAlbumContents) {
							$('#fb-album-' + I).remove()
						}
						checkExisting($(this).attr('data-href'))
					});
					$('#Back-' + I + '_3').live('click', function (e) {
						if (!B.cacheAlbumContents) {
							$('#fb-album-' + I).remove()
						}
						checkExisting($(this).attr('data-href'))
					});
					$('#Back_To_Top-' + I).click(function (e) {
						$('html, body').animate({
							scrollTop: $("#" + B.frameID).offset().top - 20
						}, 'slow')
					})
				},
				error: function (a, b, c) {
					if (B.consoleLogging) {
						console.log('Error: \njqXHR:' + a + '\ntextStatus: ' + b + '\nerrorThrown: ' + c)
					}
				}
			})
		}
		function singleAlbumShow(k) {
			var l = B.excludeImages.length + 20;
			var m = "https://graph.facebook.com/" + I + "/photos?fields=id,name,picture,created_time,updated_time,source,height,width,album,link,images&limit=" + k;
			$.ajax({
				url: m,
				cache: false,
				dataType: "jsonp",
				success: function (h) {
					$.each(h.data, function (j, a) {
						if (typeof a.picture !== "undefined") {
							if ($.inArray(a.id, B.excludeImages) == -1) {
								F = F + 1;
								if ((F <= 20) || (20 == 0)) {
									var b = "";
									if (a.name) {
										b = a.name
									}
									var c = "";
									var d = '<a id="' + I + '_' + F + '" class="photoThumb ' + I + c + '" data-key="' + F + '" rel=' + I + ' style="width:' + 210 + 'px; height:' + 155 + 'px; padding:' + 5 + 'px;" title="' + b + '" href="' + a.source + '" target="_blank">';
									if (B.photoShowClearTape) {
										d += '<span class="ClearTape" style="left: ' + (Math.ceil((210 + 10 + 5 - 77) / 2)) + 'px;"></span>'
									};
									if (B.photoShowYellowTape) {
										d += '<span class="YellowTape" style="left: ' + (Math.ceil((210 + 10 + 5 - 115) / 2)) + 'px;"></span>'
									};
									if (B.photoShowPushPin) {
										d += '<span class="PushPin" style="left: ' + (Math.ceil((210 + 10 + 5) / 2)) + 'px;"></span>'
									};
									d += '<span class="photoThumbWrap">';
									var e = a.source;
									d += '<i class="fb-photo-spinner fb-photo-spinner-' + I + '" id="fb-photo-spinner-' + a.id + '" style="width:' + 210 + 'px; height:' + 155 + 'px;  padding:' + 5 + 'px;"></i>';
									d += '<i class="fb-photo-thumb fb-photo-thumb-' + I + '" id="fb-photo-thumb-' + a.id + '" style="width:' + 210 + 'px; height:' + 155 + 'px; background-image:url(' + (e) + ')" data-loaded="FALSE" data-album="' + I + '" data-photo="' + a.id + '"></i>';
									d += '<i class="fb-photo-overlay fb-photo-overlay-' + I + '" id="fb-photo-overlay-' + a.id + '" style="width:' + 210 + 'px; height:' + 155 + 'px;  padding:' + 5 + 'px;"></i>';
									d += '</span>';
									d += '</a>';
									var f = 'width: ' + (210 + 5 * 2) + 'px; margin: ' + 10 + 'px; display: none;';
									if (((F <= k) && (F <= 20)) || (20 == 0)) {
										var g = a.source.substring(a.source.lastIndexOf('.') + 1).toUpperCase();
										$("<div>", {
											id: 'fb-photo-' + a.id,
											"class": "photoWrapper " + g,
											"data-added": a.created_time,
											"data-update": a.updated_time,
											"data-height": a.height,
											"data-width": a.width,
											"data-ID": a.id,
											"data-order": F,
											"data-type": g,
											"style": f,
											html: d
										}).appendTo('#fb-album-' + I).show()
									}
								}
							}
						}
					});
					if (B.consoleLogging) {
						console.log('Update: ' + F + ' Photo(s) for album ID "' + I + '" could be successfully retrieved!')
					}
					if ($('#fb-album-' + I + ' > .photoWrapper').length == 0) {
						$("<div>", {
							"id": 'no-fb-photos',
							html: "Sorry, there are either no images in that album or all of the images have been exluded from being shown ... Please check your settings!"
						}).appendTo('#fb-album-' + I).fadeIn(500);
						$("#" + B.loaderID).hide();
						if (B.singleAlbumInitDescription) {
							$('#fb-album-header').show()
						} else {
							$('#fb-album-header').hide()
						};
						if (B.bottomControlBar) {
							$('#fb-album-footer').show()
						};
						$("#fb-album-paged" + I).slideFade(700)
					} else {
						var i = $('#fb-album-' + I);
						$("#" + B.loaderID).hide();
						equalHeightFloat(false, I);
						currentPageList = i;
						setTimeout(function () {
							var a = F;
							var b = {
								'searchBoxDefault': B.SearchDefaultText,
								'itemsPerPageDefault': a,
								'hideFilter': false,
								'hideSort': false,
								'hideSearch': false,
								'hidePager': false
							};
							new CallPagination(i, b, "fb-album-paged-" + I, false, false, I)
						}, 500);
						$('#fb-album-' + I + ' .fb-photo-thumb').waitForImages({
							waitForAll: true,
							finished: function () {},
							each: function () {
								var a = $(this).attr("data-photo");
								if ($("#fb-photo-thumb-" + a).attr("data-loaded") == "FALSE") {
									$("#fb-photo-spinner-" + a).hide();
									$("#fb-photo-thumb-" + a).hide().fadeIn(500);
									$("#fb-photo-thumb-" + a).attr("data-loaded", "TRUE")
								}
							},
						});
						if ((B.fancyBoxAllow) && ($.isFunction($.fn.fancybox))) {
							$('a.' + I).fancybox({
								padding: 15,
								scrolling: 'auto',
								autosize: true,
								fitToView: true,
								openEffect: 'elastic',
								openEasing: 'easeInBack',
								openSpeed: 500,
								closeEffect: 'elastic',
								closeEasing: 'easeOutBack',
								closeSpeed: 500,
								closeClick: true,
								nextClick: false,
								playSpeed: 8000,
								mouseWheel: false,
								arrows: false,
								afterLoad: function () {
									this.title = $(this.element).attr("title")
								},
								beforeShow: function () {
									this.title = $(this.element).attr("title")
								},
								afterShow: function () {
									this.title = $(this.element).attr("title")
								},
								onUpdate: function () {
									this.title = $(this.element).attr("title")
								}
							})
						}
						$("#" + B.loaderID).hide();
						$('#fb-album-header').show();
						$('#fb-album-footer').show();
						$('#fb-album-' + I).show();
						setTimeout(function () {
							if (isInIFrame) {
								var a = $("#" + B.frameID).height() + 20;
								var b = $("#" + B.frameID).width() + 4;
								var c = getIframeID(this);
								if (c != "N/A") {
									window.top.document.getElementById("" + c + "").style.height = "" + a + "px";
									parent.document.getElementById("" + c + "").style.height = "" + a + "px"
								}
							}
						}, 100)
					}
				},
				error: function (a, b, c) {
					if (B.consoleLogging) {
						console.log('Error: \njqXHR:' + a + '\ntextStatus: ' + b + '\nerrorThrown: ' + c)
					}
				}
			})
		}
		function checkExisting(d) {
			if ((typeof d != 'undefined') && (d.length != 0)) {
				var f = d.split('-');
				if (f[0] == '#album') {
					if ($('#fb-albums-all-paged').length != 0) {
						$('#fb-albums-all-paged').slideFade(700)
					}
					if (I != f[1]) {
						I = f[1];
						singleAlbumInit()
					} else {
						if (B.cacheAlbumContents) {
							$("#" + B.loaderID).slideFade(700);
							$('#fb-album-header').html(J[I]);
							if (B.bottomControlBar) {
								$('#fb-album-footer').html(K[I])
							};
							$('#Back-' + I + '_1').unbind("click").bind('click', function (e) {
								checkExisting($(this).attr('data-href'))
							});
							if (B.bottomControlBar) {
								$('#Back-' + I + '_2').unbind("click").bind('click', function (e) {
									checkExisting($(this).attr('data-href'))
								});
								$('#Back_To_Top-' + I).click(function (e) {
									$('html, body').animate({
										scrollTop: $("#" + B.frameID).offset().top - 20
									}, 'slow')
								})
							};
							$('#Back-' + I + '_3').unbind("click").bind('click', function (e) {
								checkExisting($(this).attr('data-href'))
							});
							$('.paginationMain').hide();
							$("#" + B.loaderID).slideFade(700);
							setTimeout(function () {
								$('#fb-album-paged-' + I).show();
								$('#fb-album-' + I).show();
								var a = $('#fb-album-' + I);
								a.isotope('reloadItems');
								a.isotope('reLayout');
								$('html, body').animate({
									scrollTop: $("#" + B.frameID).offset().top - 20
								}, 'slow');
								if (B.consoleLogging) {
									console.log('Update: All data for Album ' + I + ' has been restored from cache and set to visible!')
								}
							}, 800)
						} else {
							singleAlbumInit()
						}
					}
				} else {
					$(".albumThumb").find(".fb-album-overlay").stop().animate({
						opacity: 0
					}, "slow");
					$(".albumThumb").find(".fb-album-loading").stop().animate({
						opacity: 0
					}, "slow");
					$('.paginationMain').hide();
					if ((B.consoleLogging) && (B.cacheAlbumContents)) {
						console.log('Update: All data for Album ' + I + ' has been cached and set to temporarily hidden!')
					}
					galleryAlbumsInit()
				}
				setTimeout(function () {
					if (isInIFrame) {
						var a = $("#" + B.frameID).height() + 20;
						var b = $("#" + B.frameID).width() + 4;
						var c = getIframeID(this);
						if (c != "N/A") {
							window.top.document.getElementById("" + c + "").style.height = "" + a + "px";
							parent.document.getElementById("" + c + "").style.height = "" + a + "px"
						}
					}
				}, 100)
			}
		}
		function equalHeightFloat(a, b) {
			var c = new Array();
			var d = new Array();
			if (a) {
				$("#fb-albums-all .albumWrapper").each(function () {
					c.push($(this).find(".albumThumb").outerHeight(true) + $(this).find(".albumDetails").outerHeight(true));
					d.push($(this).outerWidth(true))
				})
			} else {
				$("#fb-album-" + b + " .photoWrapper").each(function () {
					c.push(2 * 10 + $(this).outerHeight(true) + $(this).find(".photoThumb").outerHeight(true));
					d.push($(this).outerWidth(true))
				})
			}
			var e = Math.max.apply(Math, c);
			var f = Math.max.apply(Math, d)
		}
		function scrollBarWidth() {
			var a, child, width;
			if (width === undefined) {
				a = $('<div style="width:50px; height:50px; overflow:auto; position:absolute; top:-200px; left:-200px;"><div/>').appendTo('body');
				child = a.children();
				width = child.innerWidth() - child.height(99).innerWidth();
				a.remove()
			}
			return width
		}
		function calculateThumbsInRow() {
			var a = 0;
			$('#fb-albums-all .albumWrapper').each(function () {
				if ($(this).prev().length > 0) {
					if ($(this).position().top != $(this).prev().position().top) return false;
					a++
				} else {
					a++
				}
			});
			return a
		}
		function CallPagination(f, g, h, j, k, l) {
			var m = this;
			TotalThumbs = 0;
			TotalPages = 0;
			TotalTypes = 0;
			TotalTimes = 0;
			this.settings = {
				'searchBoxDefault': "Search ...",
				'itemsPerPageDefault': 9,
				'hideFilter': false,
				'hideSort': false,
				'hideSearch': false,
				'hidePager': false
			};
			if (g) {
				$.extend(this.settings, g)
			};
			f.wrap('<div id="' + h + '" class="paginationMain" />');
			f.addClass('paginationFrame');
			this.hideFilterDef = f.data('hidefilter') !== undefined ? f.data('hidefilter') : this.settings.hideFilter;
			this.hideSearchDef = f.data('hidesearch') !== undefined ? f.data('hidesearch') : this.settings.hideSearch;
			this.hideSortDef = f.data('hidesort') !== undefined ? f.data('hidesort') : this.settings.hideSort;
			this.hidePagerDef = f.data('hidepager') !== undefined ? f.data('hidepager') : this.settings.hidePager;
			this.PerPageItems = f.data('itemsperpage') !== undefined ? f.data('itemsperpage') : this.settings.itemsPerPageDefault;
			this.SearchBox = f.data('searchDefault') !== undefined ? f.data('searchDefault') : this.settings.searchBoxDefault;
			this.fileTypesArray = new Array();
			this.timeClassArray = new Array();
			$('.' + (j == true ? 'albumWrapper' : 'photoWrapper'), f).each(function () {
				var a = $(this);
				var b = a.attr('data-type');
				var c = a.attr('data-time');
				TotalThumbs = TotalThumbs + 1;
				if ($.inArray(b, m.fileTypesArray) == -1) {
					TotalTypes = TotalTypes + 1;
					m.fileTypesArray.push(b)
				};
				if ($.inArray(c, m.timeClassArray) == -1) {
					TotalTimes = TotalTimes + 1;
					m.timeClassArray.push(c)
				};
				a.addClass('paginationItem')
			});
			this.paginationControls = $('<div id="paginationControls-' + l + '" class="paginationControls" style="' + (j == false ? "padding-bottom: 5px;" : "") + '"></div>');
			var n = '';
			n += (this.hideSortDef === false ? '<a href="#" id="showSortingBtn-' + l + '" class="showSortingBtn float_right defaultPaginationStyle btn"><div class="AdjustSort">' + (j == true ? B.SortButtonTextAlbums : B.SortButtonTextPhotos) + '</div></a>' : '');
			n += (((this.hideFilterDef === false) && ((TotalTypes > 1) || (TotalTimes > 1))) ? '<a href="#" id="showFilterBtn-' + l + '" class="showFilterBtn float_right defaultPaginationStyle btn"><div class="AdjustType">' + (j == true ? B.FilterButtonTextAlbums : B.FilterButtonTextPhotos) + '</div></a>' : '');
			n += (this.hidePagerDef === false ? '<a href="#" id="showPagerBtn-' + l + '" class="showPagerBtn float_right defaultPaginationStyle btn"><div class="AdjustPage">' + B.PagesButtonText + '</div></a>' : '');
			n += (this.hideSearchDef === false ? '<div id="paginationSearch-' + l + '" class="paginationSearch"><label style="display:none;">Search</label><input type="text" value="' + this.settings.searchBoxDefault + '" class="paginationSearchValue"><a class="paginationSearchGo btn defaultPaginationStyle"><div class="AdjustSearch">' + (j == true ? B.SearchButtonTextAlbums : B.SearchButtonTextPhotos) + '</div></a><a class="clearSearch btn defaultPaginationStyle hidden"><div class="AdjustClear">Fjern s&oslash;gefilter</div></a></div>' : '<div class="paginationSearch" style="height: 20px;"></div>');
			n += (j === false ? '<div id="Back-' + l + '_3" class="BackButton fbLink clearfix" style="margin-top: 10px;" data-href="#">Back</div>' : "");
			var o = '<div id="paginationFilters-' + l + '" class="paginationFilters"><ul id="Filter-Selections-' + l + '" class="Selections unstyled">';
			for (var i = 0; i < m.fileTypesArray.length; i++) {
				if (m.fileTypesArray[i] != "") {
					o = o + '<li><a href="" data-filter-type="' + m.fileTypesArray[i] + '" class="' + m.fileTypesArray[i] + 'Filter ' + m.fileTypesArray[i] + ' showing FilterA">.' + m.fileTypesArray[i].toLowerCase() + ' Format</a></li>'
				}
			};
			o = o + '</ul><p class="bar"><a href="#" class="Closer">Close</a></p></div>';
			TotalPages = Math.ceil(TotalThumbs / this.PerPageItems);
			var p = '<div id="paginationPagers-' + l + '" class="paginationPagers"><ul id="Pager-Selections-' + l + '" class="Selections unstyled">';
			for (var i = 1; i < TotalPages + 1; i++) {
				p = p + '<li><a id="Page_' + i + '_' + l + '" class="" href="" data-filter-type="Page ' + i + '">' + i + '</a></li>'
			};
			p = p + '</ul><p class="bar"><a href="#" class="Closer">Close</a></p></div>';
			if (j) {
				var q = "asc";
				SortByName = q
			}
			n = n + (((this.hideFilterDef === false) && ((TotalTypes > 1) || (TotalTimes > 1))) ? o : '');
			n = n + ((this.hidePagerDef === false) ? p : '');
			n = n + ((this.hideSortDef === false && j) ? '<div id="paginationSorting-' + l + '" class="paginationSorting" style="' + (this.hideFilterDef === true ? 'right:0;' : '') + '">' + '<ul id="Sort-Selections-' + l + '" class="Selections unstyled">' + ((TotalThumbs > 1 && j) ? '<li><a id="SortByName" class="' + SortByName + '" href="" data-sort-type="bytitle" data-sort-direction="' + SortByName + '">' + B.SortNameText + '</a></li>' : '') + '</ul><p class="bar"><a href="#" class="Closer">Close</a></p></div>' : '');
			this.paginationControls.html(n);
			f.before('<div id="paginationBar-' + l + '" class="paginationBar"></div>');
			if (B.showTopPaginationBar) {
				$(".paginationBar", $("#" + h)).append('<div id="paginationButtonsTop-' + l + '" class="paginationButtons ControlsTop"><a href="#" class="pfl_last btn defaultPaginationStyle"><div id="LastPage"></div></a><a href="#" class="pfl_next btn defaultPaginationStyle"><div id="NextPage"></div></a><span class="pagingInfo">Page <span class="currentPage"></span> of <span class="totalPages"></span></span><a href="#" class="pfl_first btn defaultPaginationStyle"><div id="FirstPage"></div></a><a href="#" class="pfl_prev btn disabled defaultPaginationStyle"><div id="PrevPage"></div></a></div>')
			}
			$(".paginationBar", $("#" + h)).append(this.paginationControls);
			$(".paginationBar", $("#" + h)).append('<div style="display:none" class="paginationMessage"><div id="ErrorMessage"></div><a class="btn defaultPaginationStyle" href="#">Show All Albums</a></div>');
			$(".paginationBar", $("#" + h)).append('<div style="display:none" class="paginationEmpty"><span></span></div>');			$(".paginationBar", $("#" + h)).append('<div style="display:none" class="paginationEmpty"><span></span></div>');
			if (B.showBottomPaginationBar) {
				f.after('<div id="paginationButtonsBottom-' + l + '" class="paginationButtons ControlsBottom"><a href="#" class="pfl_last btn defaultPaginationStyle"><div id="LastPage"></div></a><a href="#" class="pfl_next btn defaultPaginationStyle"><div id="NextPage"></div></a><span class="pagingInfo">Page <span class="currentPage"></span> of <span class="totalPages"></span></span><a href="#" class="pfl_first btn defaultPaginationStyle"><div id="FirstPage"></div></a><a href="#" class="pfl_prev btn disabled defaultPaginationStyle"><div id="PrevPage"></div></a></div>')
			}
			this.allThumbsContainer = $("#" + h);
			this.messageBox = $('.paginationMessage', this.allThumbsContainer);
			this.messageText = $('span', this.messageBox);
			this.emptyThumbsBox = $('.paginationEmpty', this.allThumbsContainer);
			this.emptyThumbsText = $('span', this.emptyThumbsBox);
			this.filteredThumbs = $('.paginationItem', this.allThumbsContainer);
			this.allThumbs = $('.paginationItem', this.allThumbsContainer);
			this.fileContainer = $('.paginationFrame', this.allThumbsContainer);
			this.firstButton = $('.pfl_first', this.allThumbsContainer);
			this.lastButton = $('.pfl_last', this.allThumbsContainer);
			this.nextButton = $('.pfl_next', this.allThumbsContainer);
			this.prevButton = $('.pfl_prev', this.allThumbsContainer);
			this.pageAt = f.data('itemsperpage') !== undefined ? f.data('itemsperpage') : this.settings.itemsPerPageDefault;
			this.paginationContainer = $('.paginationButtons', this.allThumbsContainer);
			this.currentPageCounter = $('.currentPage', this.allThumbsContainer);
			this.totalPageCounter = $('.totalPages', this.allThumbsContainer);
			this.searchAndFilterContainer = this.paginationControls;
			this.showPagerBtn = $('.showPagerBtn', this.allThumbsContainer);
			this.pagerLinksContainer = $('.paginationPagers', this.allThumbsContainer);
			this.pagerLinks = $('li a', this.pagerLinksContainer);
			this.showFilterBtn = $('.showFilterBtn', this.allThumbsContainer);
			this.filterLinksContainer = $('.paginationFilters', this.allThumbsContainer);
			this.filterLinks = $('li a', this.filterLinksContainer);
			this.showSortingBtn = $('.showSortingBtn', this.allThumbsContainer);
			this.sortingLinksContainer = $('.paginationSorting', this.allThumbsContainer);
			this.sortingLinks = $('.paginationSorting li a', this.allThumbsContainer);
			this.searchBoxContainer = $('.paginationSearch', this.allThumbsContainer);
			this.searchBox = $('.paginationSearchValue', this.searchBoxContainer);
			this.searchButton = $('.paginationSearchGo', this.searchBoxContainer);
			this.clearSearchButton = $('.clearSearch', this.searchBoxContainer);
			this.currentPage = 0;
			this.totalFiles = this.filteredThumbs.length;
			this.totalPages = (Math.ceil(this.totalFiles / this.pageAt));
			if (this.pageAt < this.totalFiles) {
				this.nextButton.click(function (a) {
					a.preventDefault();
					if ($(this).hasClass('disabled')) {
						return false
					}
					m.currentPage++;
					showHidePages(m, j);
					isotopeGallery(m, f, j, false, l);
					return false
				});
				this.prevButton.click(function (a) {
					a.preventDefault();
					if ($(this).hasClass('disabled')) {
						return false
					}
					m.currentPage--;
					showHidePages(m, j);
					isotopeGallery(m, f, j, false, l);
					return false
				});
				this.firstButton.click(function (a) {
					a.preventDefault();
					if ($(this).hasClass('disabled')) {
						return false
					}
					m.currentPage = 0;
					showHidePages(m, j);
					isotopeGallery(m, f, j, false, l);
					return false
				});
				this.lastButton.click(function (a) {
					a.preventDefault();
					if ($(this).hasClass('disabled')) {
						return false
					}
					m.currentPage = m.totalPages - 1;
					showHidePages(m, j);
					isotopeGallery(m, f, j, false, l);
					return false
				})
			};
			$('.paginationPagers li a').click(function (a) {
				a.preventDefault();
				m.currentPage = $(this).text() - 1;
				showHidePages(m, j);
				m.pagerLinksContainer.toggle();
				isotopeGallery(m, f, j, false, l);
				return false
			});
			this.showFilterBtn.click(function (a) {
				a.preventDefault();
				$('#paginationFilters-' + l, this.allThumbsContainer).css("left", $('#showFilterBtn-' + l, this.allThumbsContainer).position().left + 0);
				m.sortingLinksContainer.hide();
				m.pagerLinksContainer.hide();
				m.filterLinksContainer.toggle();
				return false
			});
			$('.Closer', this.filterLinksContainer).click(function (a) {
				a.preventDefault();
				m.sortingLinksContainer.hide();
				m.pagerLinksContainer.hide();
				m.filterLinksContainer.toggle();
				return false
			});
			this.filterLinks.click(function (a) {
				a.preventDefault();
				$(this).toggleClass('showing');
				var b = $('.paginationFilters a.showing', m.allThumbsContainer);
				var c = "";
				if (b.length > 0) {
					m.fileContainer.show();
					$.each(b, function () {
						c += "." + $(this).data('filter-type') + ','
					});
					m.filteredThumbs.remove();
					m.filteredThumbs = m.allThumbs.filter(c.slice(0, -1));
					if (m.filteredThumbs.length === 0) {
						showHideMessage("Sorry, no images of selected type(s) could be found.", m, j)
					} else {
						m.fileContainer.append(m.filteredThumbs);
						sortGallery(SortingOrder, SortingType, m, j);
						m.currentPage = 0;
						resetPaging(m);
						showHidePages(m, j);
						showHideMessage("", m, j)
					};
					$(".Selections").css("max-height", 300)
				} else {
					if (((j) && (!B.albumsFilterAllEnabled)) || ((!j) && (!B.photosFilterAllEnabled))) {
						m.filteredThumbs.remove();
						m.filteredThumbs = m.allThumbs;
						m.fileContainer.append(m.filteredThumbs);
						sortGallery(SortingOrder, SortingType, m, j);
						m.currentPage = 0;
						resetPaging(m);
						showHidePages(m, j);
						showHideMessage("", m, j);
						$(".Selections").css("max-height", 300)
					} else {
						showHideMessage('No types selected.', m, j);
						$(".Selections").css("max-height", 75);
						m.fileContainer.hide()
					}
				};
				$('#paginationFilters-' + l, this.allThumbsContainer).css("left", $('#showFilterBtn-' + l, this.allThumbsContainer).position().left + 0);
				$('#paginationSorting-' + l, this.allThumbsContainer).css("left", $('#showSortingBtn-' + l, this.allThumbsContainer).position().left + 0);
				$('#paginationPagers-' + l, this.allThumbsContainer).css("left", $('#showPagerBtn-' + l, this.allThumbsContainer).position().left + 0);
				isotopeGallery(m, f, j, false, l);
				return false
			});
			this.searchBox.focus(function (e) {
				$(this).addClass("active");
				if ($(this).val() === m.settings.searchBoxDefault) {
					$(this).val("")
				}
			});
			this.searchBox.blur(function (e) {
				$(this).removeClass("active");
				if ($(this).val() === "") {
					$(this).val(m.settings.searchBoxDefault)
				};
				$.fn.lazyloadanything('load')
			});
			this.searchBox.keydown(function (e) {
				if (e.keyCode === 13) {
					m.searchButton.click()
				}
			});
			this.searchButton.click(function (e) {
				e.preventDefault();
				if (m.searchBox.val() !== "" && m.searchBox.val() !== m.settings.searchBoxDefault) {
					m.searchBox.removeClass("error");
					m.filteredThumbs.remove();
					m.filteredThumbs = m.allThumbs.filter(':containsNC(' + m.searchBox.val() + ')');
					if (m.filteredThumbs.length > 0) {
						m.fileContainer.append(m.filteredThumbs);
						m.currentPage = 0;
						resetPaging(m);
						showHidePages(m, j);
						showHideMessage("", m, j);
						m.clearSearchButton.removeClass('hidden');
						m.fileContainer.show();
						isotopeGallery(m, f, j, false, l)
					} else {
						m.clearSearchButton.removeClass('hidden');
						showHideMessage("No albums matching your keyword(s) could be found.", m, j);
						m.fileContainer.hide()
					}
				} else {
					m.searchBox.addClass("error")
				};
				$('#paginationFilters-' + l, this.allThumbsContainer).css("left", $('#showFilterBtn-' + l, this.allThumbsContainer).position().left + 0);
				$('#paginationSorting-' + l, this.allThumbsContainer).css("left", $('#showSortingBtn-' + l, this.allThumbsContainer).position().left + 0);
				$('#paginationPagers-' + l, this.allThumbsContainer).css("left", $('#showPagerBtn-' + l, this.allThumbsContainer).position().left + 0)
			});
			this.clearSearchButton.click(function (e) {
				e.preventDefault();
				m.searchBox.val(m.SearchBox);				m.searchBox.val(m.SearchBox);
				resetWholeList(m, f, l, j, k);
				isotopeGallery(m, f, j, false, l);
				return false
			});
			this.showSortingBtn.click(function (a) {
				a.preventDefault();
				$('#paginationSorting-' + l, this.allThumbsContainer).css("left", $('#showSortingBtn-' + l, this.allThumbsContainer).position().left + 0);
				m.filterLinksContainer.hide();
				m.pagerLinksContainer.hide();
				m.sortingLinksContainer.toggle();
				return false
			});
			this.showPagerBtn.click(function (a) {
				a.preventDefault();
				$('#paginationPagers-' + l, this.allThumbsContainer).css("left", $('#showPagerBtn-' + l, this.allThumbsContainer).position().left + 0);
				m.filterLinksContainer.hide();
				m.sortingLinksContainer.hide();
				m.pagerLinksContainer.toggle();
				return false
			});
			$('.Closer', this.sortingLinksContainer).click(function () {
				m.filterLinksContainer.hide();
				m.pagerLinksContainer.hide();
				m.sortingLinksContainer.toggle();
				return false
			});
			$('.Closer', this.pagerLinksContainer).click(function () {
				m.filterLinksContainer.hide();
				m.sortingLinksContainer.hide();
				m.pagerLinksContainer.toggle();
				return false
			});
			this.sortingLinks.click(function (a) {
				a.preventDefault();
				var b = $(this);
				var c = b.attr("data-sort-type");
				var d = "";
				var e = m.sortingLinks;
				d = b.attr("data-sort-direction");
				e.attr('class', '');
				if (d === "" || d === undefined) {
					e.attr('data-sort-direction', '');
					d = 'asc'
				} else {
					if (b.attr('data-sort-direction') === 'asc') {
						d = 'dec'
					} else {
						d = 'asc'
					}
				};
				b.attr('data-sort-direction', d);
				b.addClass(d);
				SortingOrder = d;
				SortingType = c;
				sortGallery(d, c, m, j);
				m.currentPage = 0;
				resetPaging(m);
				showHidePages(m, j);
				showHideMessage("", m, j);
				if (m.sortingLinksContainer.is(":hidden") == false) {
					m.sortingLinksContainer.toggle()
				};
				isotopeGallery(m, f, j, false, l);
				return false
			});
			$('.btn', m.messageBox).click(function (a) {
				a.preventDefault();
				m.searchBox.val(m.SearchBox);
				resetWholeList(m, f, l, j, k)				resetWholeList(m, f, l, j, k);
				isotopeGallery(m, f, j, false, l);
				$('#paginationFilters-' + l, this.allThumbsContainer).css("left", $('#showFilterBtn-' + l, this.allThumbsContainer).position().left + 0);
				$('#paginationSorting-' + l, this.allThumbsContainer).css("left", $('#showSortingBtn-' + l, this.allThumbsContainer).position().left + 0);
				$('#paginationPagers-' + l, this.allThumbsContainer).css("left", $('#showPagerBtn-' + l, this.allThumbsContainer).position().left + 0);
				return false
			});
			if (j) {
				initialSorting(m, f, j)
			}
			showHidePages(m, j);
			if (!j) {
				$('#paginationControls-' + l).hide()
			}
			isotopeGallery(m, f, j, true, l)
		}
		function showHideMessage(a, b, c) {
			$("#ErrorMessage", b.messageBox).html(a);
			if (a.length > 0) {
				b.filteredThumbs.remove();
				b.currentPage = 0;
				b.totalPages = 1;
				showHidePages(b, c);
				b.messageBox.show()
			} else {
				b.messageBox.hide()
			}
		};

		function showHidePages(b, c) {
			b.filteredThumbs.hide();
			b.filteredThumbs.filter(':lt(' + ((parseInt(b.currentPage) + 1) * parseInt(b.pageAt)) + ')').addClass("Showing").removeClass("Hiding").show();
			b.filteredThumbs.filter(':lt(' + ((parseInt(b.currentPage) + 0) * parseInt(b.pageAt)) + ')').addClass(			b.filteredThumbs.filter(':lt(' + ((parseInt(b.currentPage) + 0) * parseInt(b.pageAt)) + ')').addClass("Hiding").removeClass("Showing").removeClass("isotope-item").hide();
			b.fileContainer.removeClass('loading');
			if (b.currentPage === 0) {
				b.prevButton.addClass('disabled');
				b.firstButton.addClass('disabled')
			} else {
				b.prevButton.removeClass('disabled');
				b.firstButton.removeClass('disabled')
			};
			if (b.currentPage === (b.totalPages - 1)) {
				b.nextButton				b.nextButton.addClass('disabled');
				b.lastButton.addClass('disabled')
			} else {
				b.nextButton.removeClass('disabled');
				b.lastButton.removeClass('disabled')
			};
			if (b.totalPages > 1) {
				b.paginationContainer.show();
				b.currentPageCounter.text(parseInt(b.currentPage) + 1);
				$('.paginationPagers > ul > li > a').each(function () {
					if (this.innerHTML == (b.currentPage + 1)) {
						$(this).addClass('Active');
						$(this).removeClass('InActive');
						$(this).removeClass('Disabled')
					} else if (this.innerHTML > b.totalPages) {
						$(this).removeClass('Active');
						$(this).removeClass('InActive');
						$(this).addClass('Disabled')
					} else {
						$(this).removeClass('Active');
						$(this).removeClass('Disabled');
						$(this).addClass('InActive')
					}
				});
				b.showPagerBtn.show();
				resetPaging(b)
			} else {
				b.paginationContainer.hide();
				b.showPagerBtn.hide();
				if (TotalThumbs == 1) {
					b.showSortingBtn.hide()
				} else {
					b.showSortingBtn.show()
				}
			};
			var d = 0;
			$('.paginationItem', this.allThumbsContainer).each(function (a) {
				if ($(this).is(":visible")) {
					d = d + 1;
					$(this).addClass("Showing")
				} else {
					$(this).removeClass("Showing")
				}
			});
			b.paginationControls.show();
			b.fileContainer.show();
			$('span', b.emptyThumbsBox).html("");
			$('span', b.messageBox).html("");
			b.emptyThumbsBox.hide();
			if (c) {
				if ((B.albumThumbRotate) && ($.isFunction($.fn.jrumble))) {
					$('.albumThumb').jrumble({
						x: 3,
						y: 3,
						rotation: 3,
						speed: 150,
						opacity: false,
						opacityMin: 0.6
					});
					$('.albumThumb').hover(function () {
						$(this).trigger('startRumble')
					}, function () {
						$(this).trigger('stopRumble')
					});
					if (B.albumNameTitle) {
						$('.albumName').hover(function () {
							$('#' + $(this).attr("data-albumid")).trigger('startRumble')
						}, function () {
							$('#' + $(this).attr("data-albumid")).trigger('stopRumble')
						})
					}
				}
				if (B.albumThumbOverlay) {
					$(".fb-album-overlay").css("opacity", "0");
					$(".fb-album-overlay").hover(function () {
						$(this).stop().animate({
							opacity: .5
						}, "slow")
					}, function () {
						$(this).stop().animate({
							opacity: 0
						}, "slow")
					})
				} else {
					$(".fb-album-overlay").css("display", "none")
				}
			} else {
				if ((B.photoThumbRotate) && ($.isFunction($.fn.jrumble))) {
					$('.photoThumb').jrumble({
						x: 5,
						y: 5,
						rotation: 5,
						speed: 150,
						opacity: false,
						opacityMin: 0.6
					});
					$('.photoThumb').hover(function () {
						$(this).trigger('startRumble')
					}, function () {
						$(this).trigger('stopRumble')
					})
				}
				if (B.photoThumbOverlay) {
					$(".fb-photo-overlay").css("opacity", "0");
					$(".fb-photo-overlay").hover(function () {
						$(this).stop().animate({
							opacity: .5
						}, "slow")
					}, function () {
						$(this).stop().animate({
							opacity: 0
						}, "slow")
					})
				} else {
					$(".fb-photo-overlay").css("display", "none")
				}
			}
		};

		function resetWholeList(a, b, c, d, e) {};

		function resetPaging(a) {};

		function isotopeGallery(c, d, f, g, h) {
			if (f) {
				if (g) {
					setTimeout(function () {
						d.isotope({
							itemSelector: '.albumWrapper',
							animationEngine: 'best-available',
							itemPositionDataEnabled: false,
							transformsEnabled: true,
							resizesContainer: true,
							masonry: {
								columnOffset: 0
							},
							layoutMode: 'masonry',
							filter: '.Showing',
							onLayout: function (a, b) {
								isotopeHeightContainer = d.height()
							}
						}, function (a) {})
					}, 100)
				} else {
					d.isotope('reloadItems');
					d.isotope({
						itemSelector: '.albumWrapper',
						animationEngine: 'best-available',
						itemPositionDataEnabled: false,
						transformsEnabled: true,
						resizesContainer: true,
						masonry: {
							columnOffset: 0
						},
						layoutMode: 'masonry',
						filter: '.Showing',
						onLayout: function (a, b) {
							$('html, body').animate({
								scrollTop: $("#" + B.frameID).offset().top - 20
							}, 'slow')
						}
					}, function (a) {})
				}
			} else {
				if (g) {
					setTimeout(function () {
						d.isotope({
							itemSelector: '.photoWrapper',
							animationEngine: 'best-available',
							itemPositionDataEnabled: false,
							transformsEnabled: true,
							resizesContainer: true,
							masonry: {
								columnOffset: 0
							},
							layoutMode: 'masonry',
							filter: '.Showing',
							onLayout: function (a, b) {
								isotopeHeightContainer = d.height();
								$('#Back-' + I + '_3').unbind("click").bind('click', function (e) {
									checkExisting($(this).attr('data-href'))
								})
							}
						}, function (a) {})
					}, 100)
				} else {
					d.isotope('reloadItems');
					d.isotope({
						itemSelector: '.photoWrapper',
						animationEngine: 'best-available',
						itemPositionDataEnabled: false,
						transformsEnabled: true,
						resizesContainer: true,
						masonry: {
							columnOffset: 0
						},
						layoutMode: 'masonry',
						filter: '.Showing',
						onLayout: function (a, b) {
							$('html, body').animate({
								scrollTop: $("#" + B.frameID).offset().top - 20
							}, 'slow')
						}
					}, function (a) {})
				}
			}
			return false
		}
		function initialSorting(a, b, c) {
			if (c) {
				sortType = "bytitle";
				sortGallery("asc", sortType, a, c)
			} else {
				sortType = "byadded";
				sortGallery("asc", sortType, a, c)
			}
		}
		function sortGallery(a, b, c, d) {
			c.filteredThumbs.remove();
			var e = a + "_" + b;
			switch (e) {
			case 'asc_byorder':
				c.filteredThumbs = c.filteredThumbs.sort(asc_byorder);
				break;
			case 'dec_byorder':
				c.filteredThumbs = c.filteredThumbs.sort(dec_byorder);
				break;
			case 'asc_bysize':
				c.filteredThumbs = c.filteredThumbs.sort(asc_bysize);
				break;
			case 'dec_bysize':
				c.filteredThumbs = c.filteredThumbs.sort(dec_bysize);
				break;
			case 'asc_bycreate':
				c.filteredThumbs = c.filteredThumbs.sort(asc_bycreate);
				break;
			case 'dec_bycreate':
				c.filteredThumbs = c.filteredThumbs.sort(dec_bycreate);
				break;
			case 'asc_byupdate':
				c.filteredThumbs = c.filteredThumbs.sort(asc_byupdate);
				break;
			case 'dec_byupdate':
				c.filteredThumbs = c.filteredThumbs.sort(dec_byupdate);
				break;
			case 'asc_bytitle':
				c.filteredThumbs = c.filteredThumbs.sort(asc_bytitle);
				break;
			case 'dec_bytitle':
				c.filteredThumbs = c.filteredThumbs.sort(dec_bytitle);
				break;
			case 'asc_byadded':
				c.filteredThumbs = c.filteredThumbs.sort(asc_byadded);
				break;
			case 'dec_byadded':
				c.filteredThumbs = c.filteredThumbs.sort(dec_byadded);
				break;
			case 'asc_byID':
				c.filteredThumbs = c.filteredThumbs.sort(asc_byID);
				break;
			case 'dec_byID':
				c.filteredThumbs = c.filteredThumbs.sort(dec_byID);
				break;
			default:
				c.filteredThumbs = c.filteredThumbs.sort(asc_bytitle);
				break
			};
			c.fileContainer.hide().append(c.filteredThumbs).fadeIn('slow')
		};

		function asc_bytitle(a, b) {
			var c = $(a).attr("data-title").toUpperCase();
			var d = $(b).attr("data-title").toUpperCase();
			return (c < d) ? -1 : (c > d) ? 1 : 0
		};

		function dec_bytitle(a, b) {
			var c = $(a).attr("data-title").toUpperCase();
			var d = $(b).attr("data-title").toUpperCase();
			return (c > d) ? -1 : (c < d) ? 1 : 0
		};
		$("#" + B.frameID).append("<div id='" + B.loaderID + "' class='clearfix'></div>");
		$("#" + B.frameID).append("<div id='" + B.galleryID + "' class='clearfix'></div>");
		if (B.responsiveGallery) {
			$("#" + B.frameID).css("width", B.responsiveWidth + "%").css("padding", "5px 0px")
		} else {
			$("#" + B.frameID).css("width", B.fixedWidth + "px").css("padding", "5px 0px")
		}
		$("<div>", {
			id: "fb-album-header"
		}).appendTo("#" + B.galleryID);
		$("<div>", {
			id: "fb-album-content"
		}).appendTo("#" + B.galleryID);
		if (B.bottomControlBar) {
			$("<div>", {
				id: "fb-album-footer"
			}).appendTo("#" + B.galleryID)
		}
		$('.paginationMain').hide();
		galleryAlbumsInit()
	}
})(jQuery);
(function ($) {
	var o = 'waitForImages';
	$.waitForImages = {
		hasImageProperties: ['backgroundImage', 'listStyleImage', 'borderImage', 'borderCornerImage']
	};
	$.expr[':'].uncached = function (a) {
		if (!$(a).is('img[src!=""]')) {
			return false
		}
		var b = new Image();
		b.src = a.src;
		return !b.complete
	};
	$.fn.waitForImages = function (j, k, l) {
		var m = 0;
		var n = 0;
		if ($.isPlainObject(arguments[0])) {
			l = arguments[0].waitForAll;
			k = arguments[0].each;
			j = arguments[0].finished
		}
		j = j || $.noop;
		k = k || $.noop;
		l = !! l;
		if (!$.isFunction(j) || !$.isFunction(k)) {
			throw new TypeError('An invalid callback was supplied.');
		}
		return this.each(function () {
			var e = $(this);
			var f = [];
			var g = $.waitForImages.hasImageProperties || [];
			var h = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
			if (l) {
				e.find('*').andSelf().each(function () {
					var d = $(this);
					if (d.is('img:uncached')) {
						f.push({
							src: d.attr('src'),
							element: d[0]
						})
					}
					$.each(g, function (i, a) {
						var b = d.css(a);
						var c;
						if (!b) {
							return true
						}
						while (c = h.exec(b)) {
							f.push({
								src: c[2],
								element: d[0]
							})
						}
					})
				})
			} else {
				e.find('img:uncached').each(function () {
					f.push({
						src: this.src,
						element: this
					})
				})
			}
			m = f.length;
			n = 0;
			if (m === 0) {
				j.call(e[0])
			}
			$.each(f, function (i, b) {
				var c = new Image();
				$(c).bind('load.' + o + ' error.' + o, function (a) {
					n++;
					k.call(b.element, n, m, a.type == 'load');
					if (n == m) {
						j.call(e[0]);
						return false
					}
				});
				c.src = b.src
			})
		})
	}
}(jQuery));
(function ($) {
	if ($.isFunction($.fn.isotope)) {
		$.Isotope.prototype.flush = function () {
			this.$allAtoms = $();
			this.$filteredAtoms = $()
		};
		$.Isotope.prototype._getCenteredMasonryColumns = function () {
			var a = -1;
			$('.albumWrapper').each(function () {
				a = a > $(this).height() ? a : $(this).height()
			});
			$('.albumWrapper').each(function () {
				$(this).height(a)
			});
			var b = this.options.masonry && this.options.masonry.columnOffset || 0;
			this.width = this.element.width();
			var c = this.element.parent().width();
			var d = this.options.masonry && this.options.masonry.columnWidth || this.$filteredAtoms.outerWidth(true) || c;
			var e = Math.floor(c / d);
			e = Math.max(e, 1);
			this.masonry.cols = e;
			this.masonry.columnWidth = d
		};
		$.Isotope.prototype._masonryReset = function () {
			this.masonry = {};
			this._getCenteredMasonryColumns();
			var i = this.masonry.cols;
			this.masonry.colYs = [];
			while (i--) {
				this.masonry.colYs.push(0)
			}
		};
		$.Isotope.prototype._masonryResizeChanged = function () {
			var a = this.masonry.cols;
			this._getCenteredMasonryColumns();
			return (this.masonry.cols !== a)
		};
		$.Isotope.prototype._masonryGetContainerSize = function () {
			var a = 0,
				i = this.masonry.cols;
			var b = this.options.masonry && this.options.masonry.gutterWidth || 0;
			while (--i) {
				if (this.masonry.colYs[i] !== 0) {
					break
				}
				a++
			}
			return {
				height: Math.max.apply(Math, this.masonry.colYs),
				width: (this.masonry.cols - a) * this.masonry.columnWidth
			}
		}
	}
})(jQuery);
(function ($) {
	$.fn.stickyScroll = function (g) {
		var h = {
			init: function (e) {
				var f;
				if (e.mode !== 'auto' && e.mode !== 'manual') {
					if (e.container) {
						e.mode = 'auto'
					}
					if (e.bottomBoundary) {
						e.mode = 'manual'
					}
				};
				f = $.extend({
					mode: 'auto',
					container: $('body'),
					topBoundary: null,
					bottomBoundary: null
				}, e);

				function bottomBoundary() {
					return f.container.offset().top + isotopeHeightContainer
				};

				function topBoundary() {
					return f.container.offset().top
				};

				function elHeight(a) {
					return $(a).attr('offsetHeight')
				};
				f.container = $(f.container);
				if (!f.container.length) {
					if (console) {
						console.log('StickyScroll: the element ' + e.container + ' does not exist, we\'re throwing in the towel.')
					};
					return
				};
				if (f.mode === 'auto') {
					f.topBoundary = topBoundary();
					f.bottomBoundary = bottomBoundary()
				};
				return this.each(function (c) {
					var d = $(this),
						win = $(window),
						id = XDate.now() + c,
						height = elHeight(d);
					d.data('sticky-id', id);
					win.bind('scroll.stickyscroll-' + id, function () {
						var a = $(document).scrollTop();
						var b = a - isotopeHeightContainer;
						if (b - f.topBoundary >= 0) {
							d.offset({
								top: $(document).height() - f.bottomBoundary - height
							}).removeClass('sticky-active').removeClass('sticky-inactive').addClass('sticky-stopped');
							$("#Back_To_Top").show()
						} else if (a > f.topBoundary) {
							d.offset({
								top: $(window).scrollTop() + controlBarAdjust
							}).removeClass('sticky-stopped').removeClass('sticky-inactive').addClass('sticky-active');
							$("#Back_To_Top").show()
						} else if (a < f.topBoundary) {
							d.css({
								position: '',
								top: '',
								bottom: ''
							}).removeClass('sticky-stopped').removeClass('sticky-active').addClass('sticky-inactive');
							$("#Back_To_Top").hide()
						}
					});
					win.bind('resize.stickyscroll-' + id, function () {
						if (f.mode === 'auto') {
							f.topBoundary = topBoundary();
							f.bottomBoundary = bottomBoundary()
						};
						height = elHeight(d);
						$(this).scroll()
					});
					d.addClass('sticky-processed');
					win.scroll()
				})
			},
			reset: function () {
				return this.each(function () {
					var a = $(this),
						id = a.data('sticky-id');
					a.css({
						position: '',
						top: '',
						bottom: ''
					}).removeClass('sticky-stopped').removeClass('sticky-active').removeClass('sticky-inactive').removeClass('sticky-processed');
					$(window).unbind('.stickyscroll-' + id)
				})
			}
		};
		if (h[g]) {
			return h[g].apply(this, Array.prototype.slice.call(arguments, 1))
		} else if (typeof g === 'object' || !g) {
			return h.init.apply(this, arguments)
		} else if (console) {
			console.log('Method' + g + ' does not exist on jQuery.stickyScroll')
		}
	}
})(jQuery);
var XDate = function (g, m, A, p) {
	function f() {
		var a = this instanceof f ? this : new f,
			c = arguments,
			b = c.length,
			d;
		typeof c[b - 1] == "boolean" && (d = c[--b], c = q(c, 0, b));
		if (b) if (b == 1) if (b = c[0], b instanceof g || typeof b == "number") a[0] = new g(+b);
		else if (b instanceof f) {
			var c = a,
				h = new g(+b[0]);
			if (l(b)) h.toString = w;
			c[0] = h
		} else {
			if (typeof b == "string") {
				a[0] = new g(0);
				a: {
					for (var c = b, b = d || !1, h = f.parsers, r = 0, e; r < h.length; r++) if (e = h[r](c, b, a)) {
						a = e;
						break a
					}
					a[0] = new g(c)
				}
			}
		} else a[0] = new g(n.apply(g, c)), d || (a[0] = s(a[0]));
		else a[0] = new g;
		typeof d == "boolean" && B(a, d);
		return a
	}
	function l(a) {
		return a[0].toString === w
	}
	function B(a, c, b) {
		if (c) {
			if (!l(a)) b && (a[0] = new g(n(a[0].getFullYear(), a[0].getMonth(), a[0].getDate(), a[0].getHours(), a[0].getMinutes(), a[0].getSeconds(), a[0].getMilliseconds()))), a[0].toString = w
		} else l(a) && (a[0] = b ? s(a[0]) : new g(+a[0]));
		return a
	}
	function C(a, c, b, d, h) {
		var e = k(j, a[0], h),
			a = k(D, a[0], h),
			h = c == 1 ? b % 12 : e(1),
			f = !1;
		d.length == 2 && typeof d[1] == "boolean" && (f = d[1], d = [b]);
		a(c, d);
		f && e(1) != h && (a(1, [e(1) - 1]), a(2, [E(e(0), e(1))]))
	}
	function F(a, c, b, d) {
		var b = Number(b),
			h = m.floor(b);
		a["set" + o[c]](a["get" + o[c]]() + h, d || !1		a["set" + o[c]](a["get" + o[c]]() + h, d || !1);
		h != b && c < 6 && F(a, c + 1, (b - h) * G[c], d)
	}
	function H(a, c, b) {
		var a = a.clone().setUTCMode(!0, !0),
			c = f(c).setUTCMode(!0, !0),
			d = 0;
		if (b == 0 || b == 1) {
			for (var h = 6; h >= b; h--) d /= G[h], d += j(c, !1, h) - j(a, !1, h);
			b == 1 && (d += (c.getFullYear() - a.getFullYear()) * 12)
		} else b == 2 ? (b = a.toDate().setUTCHours(0, 0, 0, 0), d = c.toDate().setUTCHours(0, 0, 0, 0), d = m.round((d - b) / 864E5) + (c - d - (a - b)) / 864E5) : d = (c - a) / [36E5, 6E4, 1E3, 1][b - 3];
		return d
	}
	function t(a) {
		var c = a(0),
			b = a(1),
			a = a(2),
			b = new g(n(c, b, a)),
			d = u(c),
			a = d;
		b < d ? a = u(c - 1) : (c = u(c + 1), b >= c && (a = c));
		return m.floor(m.round((b - a) / 864E5) / 7) + 1
	}
	function u(a) {
		a = new g(n(a, 0, 4));
		a.setUTCDate(a.getUTCDate() - (a.getUTCDay() + 6) % 7);
		return a
	}
	function I(a, c, b, d) {
		var h = k(j, a, d),
			e = k(D, a, d),
			b = u(b === p ? h(0) : b);
		d || (b = s(b));
		a.setTime(+b);
		e(2, [h(2) + (c - 1) * 7])
	}
	function J(a, c, b, d, e) {
		var r = f.locales,
			g = r[f.defaultLocale] || {},
			i = k(j, a, e),
			b = (typeof b == "string" ? r[b] : b) || {};
		return x(a, c, function (a) {
			if (d) for (var b = (a == 7 ? 2 : a) - 1; b >= 0; b--) d.push(i(b));
			return i(a)
		}, function (a) {
			return b[a] || g[a]
		}, e)
	}
	function x(a, c, b, d, e) {
		for (var f, g, i = ""; f = c.match(M);) {
			i += c.substr(0, f.index);
			if (f[1]) {
				g = i;
				for (var i = a, j = f[1], l = b, m = d, n = e, k = j.length, o = void 0, q = ""; k > 0;) o = N(i, j.substr(0, k), l, m, n), o !== p ? (q += o, j = j.substr(k), k = j.length) : k--;
				i = g + (q + j)
			} else f[3] ? (g = x(a, f[4], b, d, e), parseInt(g.replace(/\D/g, ""), 10) && (i += g)) : i += f[7] || "'";
			c = c.substr(f.index + f[0].length)
		}
		return i + c
	}
	function N(a, c, b, d, e) {
		var g = f.formatters[c];
		if (typeof g == "string") return x(a, g, b, d, e);
		else if (typeof g == "function") return g(a, e || !1, d);
		switch (c) {
		case "fff":
			return i(b(6), 3);
		case "s":
			return b(5);
		case "ss":
			return i(b(5));
		case "m":
			return b(4);
		case "mm":
			return i(b(4));
		case "h":
			return b(3) % 12 || 12;
		case "hh":
			return i(b(3) % 12 || 12);
		case "H":
			return b(3);
		case "HH":
			return i(b(3));
		case "d":
			return b(2);
		case "dd":
			return i(b(2));
		case "ddd":
			return d("dayNamesShort")[b(7)] || "";
		case "dddd":
			return d("dayNames")[b(7)] || "";
		case "M":
			return b(1) + 1;
		case "MM":
			return i(b(1) + 1);
		case "MMM":
			return d("monthNamesShort")[b(1)] || "";
		case "MMMM":
			return d("monthNames")[b(1)] || "";
		case "yy":
			return (b(0) + "").substring(2);
		case "yyyy":
			return b(0);
		case "t":
			return v(b, d).substr(0, 1).toLowerCase();
		case "tt":
			return v(b, d).toLowerCase();
		case "T":
			return v(b, d).substr(0, 1);
		case "TT":
			return v(b, d);
		case "z":
		case "zz":
		case "zzz":
			return e ? c = "Z" : (d = a.getTimezoneOffset(), a = d < 0 ? "+" : "-", b = m.floor(m.abs(d) / 60), d = m.abs(d) % 60, e = b, c == "zz" ? e = i(b) : c == "zzz" && (e = i(b) + ":" + i(d)), c = a + e), c;
		case "w":
			return t(b);
		case "ww":
			return i(t(b));
		case "S":
			return c = b(2), c > 10 && c < 20 ? "th" : ["st", "nd", "rd"][c % 10 - 1] || "th"
		}
	}
	function v(a, c) {
		return a(3) < 12 ? c("amDesignator") : c("pmDesignator")
	}
	function y(a) {
		return !isNaN(+a[0])
	}
	function j(a, c, b) {
		return a["get" + (c ? "UTC" : "") + o[b]]()
	}
	function D(a, c, b, d) {
		a["set" + (c ? "UTC" : "") + o[b]].apply(a, d)
	}
	function s(a) {
		return new g(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate(), a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds())
	}
	function E(a, c) {
		return 32 - (new g(n(a, c, 32))).getUTCDate()
	}
	function z(a) {
		return function () {
			return a.apply(p, [this].concat(q(arguments)))
		}
	}
	function k(a) {
		var c = q(arguments, 1);
		return function () {
			return a.apply(p, c.concat(q(arguments)))
		}
	}
	function q(a, c, b) {
		return A.prototype.slice.call(a, c || 0, b === p ? a.length 		return A.prototype.slice.call(a, c || 0, b === p ? a.length : b)
	}
	function K(a, c) {
		for (var b = 0; b < a.length; b++) c(a[b], b)
	}
	function i(a, c) {
		c = c || 2;
		for (a += ""; a.length < c;) a = "0" + a;
		return a
	}
	var o = "FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds,Day,Year".split(","),
		L = ["Years", "Months", "Days"],
		G = [12, 31, 24, 60, 60, 1E3, 1],
		M = /(([a-zA-Z])\2*)|(\((('.*?'|\(.*?\)|.)*?)\))|('(.*?)')/,
		n = g.UTC,
		w = g.prototype.toUTCString,
		e = f.prototype;
	e.length = 1;
	e.splice = A.prototype.splice;
	e.getUTCMode = z(l);
	e.setUTCMode = z(B);
	e.getTimezoneOffset = function () {
		return l(this) ? 0 : this[0].getTimezoneOffset()
	};
	K(o, function (a, c) {
		e["get" + a] = function () {
			return j(this[0], l(this), c)
		};
		c != 8 && (e["getUTC" + a] = function () {
			return j(this[0], !0, c)
		});
		c != 7 && (e["set" + a] = function (a) {
			C(this, c, a, arguments, l(this));
			return this
		}, c != 8 && (e["setUTC" + a] = function (a) {
			C(this, c, a, arguments, !0);
			return this
		}, e["add" + (L[c] || a)] = function (a, d) {
			F(this, c, a, d);
			return this
		}, e["diff" + (L[c] || a)] = function (a) {
			return H(this, a, c)
		}))
	});
	e.getWeek = function () {
		return t(k(j, this, !1))
	};
	e.getUTCWeek = function () {
		return t(k(j, this, !0))
	};
	e.setWeek = function (a, c) {
		I(this, a, c, !1);
		return this
	};
	e.setUTCWeek = function (a, c) {
		I(this, a, c, !0);
		return this
	};
	e.addWeeks = function (a) {
		return this.addDays(Number(a) * 7)
	};
	e.diffWeeks = function (a) {
		return H(this, a, 2) / 7
	};
	f.parsers = [function (a, c, b) {
		if (a = a.match(/^(\d{4})(-(\d{2})(-(\d{2})([T ](\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/)) {
			var d = new g(n(a[1], a[3] ? a[3] - 1 : 0, a[5] || 1, a[7] || 0, a[8] || 0, a[10] || 0, a[12] ? Number("0." + a[12]) * 1E3 : 0));
			a[13] ? a[14] && d.setUTCMinutes(d.getUTCMinutes() + (a[15] == "-" ? 1 : -1) * (Number(a[16]) * 60 + (a[18] ? Number(a[18]) : 0))) : c || (d = s(d));
			return b.setTime(+d)
		}
	}];
	f.parse = function (a) {
		return +f("" + a)
	};
	e.toString = function (a, c, b) {
		return a === p || !y(this) ? this[0].toString() : J(this, a, c, b, l(this))
	};
	e.toUTCString = e.toGMTString = function (a, c, b) {
		return a === p || !y(this) ? this[0].toUTCString() : J(this, a, c, b, !0)
	};
	e.toISOString = function () {
		return this.toUTCString("yyyy-MM-dd'T'HH:mm:ss(.fff)zzz")
	};
	f.defaultLocale = "";
	f.locales = {
		"": {
			monthNames: "January,February,March,April,May,June,July,August,September,October,November,December".split(","),
			monthNamesShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),
			dayNames: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),
			dayNamesShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
			amDesignator: "AM",
			pmDesignator: "PM"
		}
	};
	f.formatters = {
		i: "yyyy-MM-dd'T'HH:mm:ss(.fff)",
		u: "yyyy-MM-dd'T'HH:mm:ss(.fff)zzz"
	};
	K("getTime,valueOf,toDateString,toTimeString,toLocaleString,toLocaleDateString,toLocaleTimeString,toJSON".split(","), function (a) {
		e[a] = function () {
			return this[0][a]()
		}
	});
	e.setTime = function (a) {
		this[0].setTime(a);
		return this
	};
	e.valid = z(y);
	e.clone = function () {
		return new f(this)
	};
	e.clearTime = function () {
		return this.setHours(0, 0, 0, 0)
	};
	e.toDate = function () {
		return new g(+this[0])
	};
	f.now = function () {
		return +new g
	};
	f.today = function () {
		return (new f).clearTime()
	};
	f.UTC = n;
	f.getDaysInMonth = E;
	if (typeof module !== "undefined" && module.exports) module.exports = f;
	return f
}(Date, Math, Array);
(function (f) {
	f.fn.jrumble = function (g) {
		var a = f.extend({
			x: 2,
			y: 2,
			rotation: 1,
			speed: 15,
			opacity: false,
			opacityMin: 0.5
		}, g);
		return this.each(function () {
			var b = f(this),
				h = a.x * 2,
				i = a.y * 2,
				k = a.rotation * 2,
				g = a.speed === 0 ? 1 : a.speed,
				m = a.opacity,
				n = a.opacityMin,
				l, j, o = function () {
					var e = Math.floor(Math.random() * (h + 1)) - h / 2,
						a = Math.floor(Math.random() * (i + 1)) - i / 2,
						c = Math.floor(Math.random() * (k + 1)) - k / 2,
						d = m ? Math.random() + n : 1,
						e = e === 0 && h !== 0 ? Math.random() < 0.5 ? 1 : -1 : e,
						a = a === 0 && i !== 0 ? Math.random() < 0.5 ? 1 : -1 : a;
					b.css("display") === "inline" && (l = true, b.css("display", "inline-block"));
					b.css({
						position: "relative",
						left: e + "px",
						top: a + "px",
						"-ms-filter": "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + d * 100 + ")",
						filter: "alpha(opacity=" + d * 100 + ")",
						"-moz-opacity": d,
						"-khtml-opacity": d,
						opacity: d,
						"-webkit-transform": "rotate(" + c + "deg)",
						"-moz-transform": "rotate(" + c + "deg)",
						"-ms-transform": "rotate(" + c + "deg)",
						"-o-transform": "rotate(" + c + "deg)",
						transform: "rotate(" + c + "deg)"
					})
				},
				p = {
					left: 0,
					top: 0,
					"-ms-filter": "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)",
					filter: "alpha(opacity=100)",
					"-moz-opacity": 1,
					"-khtml-opacity": 1,
					opacity: 1,
					"-webkit-transform": "rotate(0deg)",
					"-moz-transform": "rotate(0deg)",
					"-ms-transform": "rotate(0deg)",
					"-o-transform": "rotate(0deg)",
					transform: "rotate(0deg)"
				};
			b.bind({
				startRumble: function (a) {
					a.stopPropagation();
					clearInterval(j);
					j = setInterval(o, g)
				},
				stopRumble: function (a) {
					a.stopPropagation();
					clearInterval(j);
					l && b.css("display", "inline");
					b.css(p)
				}
			})
		})
	}
})(jQuery);